package com.jpa.sepcification.demo.web.test.rest;

import com.jpa.sepcification.demo.test.service.UserService;
import com.jpa.sepcification.demo.test.service.dto.UserDTO;
import com.jpa.sepcification.demo.web.test.vo.UserVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * User Controller层
 *
 * @author 自动生成
 * @date 2020-12-28 13:34:38
 */
@RestController
@RequestMapping("/api/users")
public class UserController {

	private final UserService userService;

	public UserController(UserService userService) {
		this.userService = userService;
	}


	/**
	 * 条件查询所有
	 *
	 * @param userVO 查询条件
	 * @return 所有符合条件的列表
	 */
	@GetMapping("/all")
	public List<UserDTO> findAll(UserVO userVO) {
		return userService.findAll(userVO);
	}
}
